﻿using System;
using System.ComponentModel;
using System.Text;

namespace SSLVerifier.API.ModelObjects {
	public class StringBuilderWrapper : INotifyPropertyChanged {
		private readonly StringBuilder _builder = new StringBuilder();

		public string Text {
			get { return _builder.ToString(); }
		}
		void OnPropertyChanged(String propName) {
			PropertyChangedEventHandler handler = PropertyChanged;
			if (handler != null) {
				handler(this, new PropertyChangedEventArgs(propName));
			}
		}

		public void Add(String text) {
			_builder.Append(text);
			OnPropertyChanged("Text");
		}
		public void Clear() {
			_builder.Clear();
		}

		public event PropertyChangedEventHandler PropertyChanged;
	}
}
